<div class="{{$viewClass['form-group']}}">

    <label class="{{$viewClass['label']}} control-label">{{$label}}</label>

    <div class="{{$viewClass['field']}}">

        @include('admin::form.error')

        <textarea name="{{ $name}}" placeholder="{{ $placeholder }}" {!! $attributes !!} >{!! $value !!}</textarea>

        @include('admin::form.help-block')

    </div>
</div>

<script require="@ckeditor" init="{!! $selector !!}">
    var ckeditor = $this.ckeditor({
        removePlugins:'easyimage,cloudservices',
        filebrowserImageUploadUrl:'{!! $uploadImageUrl !!}',
        filebrowserUploadUrl: '{!! $uploadFilesUrl !!}',
    })
    ckeditor.editor.on( 'fileUploadRequest', function( evt ) {
      var fileLoader = evt.data.fileLoader,
        formData = new FormData(),
        xhr = fileLoader.xhr;
        xhr.open('POST',fileLoader.uploadUrl, true );
        formData.append('file', fileLoader.file, fileLoader.fileName );
        fileLoader.xhr.send( formData );
        evt.stop();
    })
    ckeditor.editor.on( 'fileUploadResponse', function( evt ) {
        evt.stop();
        var data = evt.data,xhr = data.fileLoader.xhr,response = JSON.parse(xhr.responseText);
        if(response.status&&response.status===false){
            Dcat.error(response.data.message);
            evt.cancel();
        }else if(response.location){
            data.url = response.location;
            Dcat.success("上传成功!");
        }
    });

</script>
